package com.youlu.campus.admin.channel;

import com.youlu.campus.entity.channel.dto.AppChannelDTO;
import com.youlu.campus.entity.channel.dto.AppChannelQueryDTO;
import com.youlu.campus.service.channel.AppChannelService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class AppChannelController {

    @Autowired
   private AppChannelService appChannelService;

    @PostMapping("/app/channel/save")
    public QResult save(@RequestBody AppChannelDTO dto){
        appChannelService.save(dto);
        return QResult.success(null);
    }

    @DeleteMapping("/app/channel/delete/{id}")
    public QResult delete(@PathVariable String id){
        appChannelService.delete(id);
        return QResult.success(null);
    }

    @PostMapping("/app/channel/list")
    public QResult save(@RequestBody AppChannelQueryDTO dto){
        return QResult.success(appChannelService.list(dto));
    }
}
